﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ejecucion_tareas.ascx.cs" Inherits="ejecucion_tareas" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
    <table align="center">
        <tr>
            <td>
                <dxwgv:ASPxGridView ID="gvTareas" runat="server" AutoGenerateColumns="False" 
                    CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                    DataSourceID="dsTareasLineaDeTiempo" KeyFieldName="ID">
                    <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                    </Styles>
                    <SettingsLoadingPanel Text="" />
                    <SettingsPager Mode="ShowAllRecords">
                        <AllButton>
                            <Image Height="19px" Width="27px" />
                        </AllButton>
                        <FirstPageButton>
                            <Image Height="19px" Width="23px" />
                        </FirstPageButton>
                        <LastPageButton>
                            <Image Height="19px" Width="23px" />
                        </LastPageButton>
                        <NextPageButton>
                            <Image Height="19px" Width="19px" />
                        </NextPageButton>
                        <PrevPageButton>
                            <Image Height="19px" Width="19px" />
                        </PrevPageButton>
                    </SettingsPager>
                    <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                        <CollapsedButton Height="15px" 
                            Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                        <ExpandedButton Height="15px" 
                            Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                        <DetailCollapsedButton Height="15px" 
                            Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                        <DetailExpandedButton Height="15px" 
                            Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                        <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                            Width="19px" />
                        <HeaderActiveFilter Height="19px" 
                            Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                        <HeaderSortDown Height="5px" 
                            Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                        <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                            Width="7px" />
                        <FilterRowButton Height="13px" Width="13px" />
                        <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                            Width="13px" />
                    </Images>
                    <SettingsText EmptyDataRow="No se encontraron tareas activas" />
                    <Columns>
                        <dxwgv:GridViewDataButtonEditColumn VisibleIndex="0">
                            <DataItemTemplate>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <dxe:ASPxButton ID="btnIniciar" runat="server" 
                                                CommandArgument="<%# ((GridViewDataItemTemplateContainer)Container).KeyValue %>" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                Enabled='<%# Eval("PuedeIniciar") %>' onclick="btnIniciar_Click" Text="Iniciar">
                                            </dxe:ASPxButton>
                                        </td>
                                        <td>
                                            <dxe:ASPxButton ID="btnFinalizar" runat="server" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                Text="Finalizar" 
                                                CommandArgument="<%# ((GridViewDataItemTemplateContainer)Container).KeyValue %>" 
                                                onclick="btnFinalizar_Click">
                                                <ClientSideEvents Click="function(s, e) {
	e.processOnServer = confirm('La tarea será finalizada, ¿esta seguro?');
}" />
                                                <ClientSideEvents Click="function(s, e) {
	e.processOnServer = confirm('La tarea será finalizada, ¿esta seguro?');
}" />
                                            </dxe:ASPxButton>
                                        </td>
                                        <td align="left" nowrap="nowrap">
                                            <dxe:ASPxComboBox ID="ddlMotivos" runat="server" DataSourceID="dsMotivos" 
                                                TextField="Descripcion" ValueField="ID" ValueType="System.String" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                Enabled='<%# Eval("PuedePausar") %>' ImageFolder="~/App_Themes/Aqua/{0}/" 
                                                LoadingPanelText="" ShowShadow="False">
                                                <ButtonEditEllipsisImage Height="3px" 
                                                    Url="~/App_Themes/Aqua/Editors/edtEllipsis.png" 
                                                    UrlDisabled="~/App_Themes/Aqua/Editors/edtEllipsisDisabled.png" 
                                                    UrlHottracked="~/App_Themes/Aqua/Editors/edtEllipsisHottracked.png" 
                                                    UrlPressed="~/App_Themes/Aqua/Editors/edtEllipsisPressed.png" Width="12px" />
                                                <ButtonEditEllipsisImage Height="3px" 
                                                    Url="~/App_Themes/Aqua/Editors/edtEllipsis.png" 
                                                    UrlDisabled="~/App_Themes/Aqua/Editors/edtEllipsisDisabled.png" 
                                                    UrlHottracked="~/App_Themes/Aqua/Editors/edtEllipsisHottracked.png" 
                                                    UrlPressed="~/App_Themes/Aqua/Editors/edtEllipsisPressed.png" Width="12px" />
                                                <DropDownButton>
                                                    <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                                        UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownPressed.png" Width="9px" />
                                                    <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                                        UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                                        UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                                        UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownPressed.png" Width="9px" />
                                                </DropDownButton>
                                                <ValidationSettings>
                                                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" 
                                                        Width="14px" />
                                                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" 
                                                        Width="14px" />
                                                    <ErrorFrameStyle ImageSpacing="4px">
                                                        <ErrorTextPaddings PaddingLeft="4px" />
                                                        <ErrorTextPaddings PaddingLeft="4px" />
                                                    </ErrorFrameStyle>
                                                </ValidationSettings>
                                            </dxe:ASPxComboBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                ControlToValidate="ddlMotivos" Display="Dynamic" 
                                                ErrorMessage="Debe seleccionar un motivo." ValidationGroup='<%# Eval("ID") %>'></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            <dxe:ASPxButton ID="btnPausar" runat="server" 
                                                CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                                Enabled='<%# Eval("PuedePausar") %>' Text="Pausar" 
                                                CommandArgument="<%# ((GridViewDataItemTemplateContainer)Container).KeyValue %>" 
                                                onclick="btnPausar_Click" ValidationGroup='<%# Eval("ID") %>'>
                                            </dxe:ASPxButton>
                                        </td>
                                    </tr>
                                </table>
                            </DataItemTemplate>
                            <CellStyle>
                                <BorderLeft BorderStyle="None" />
                            </CellStyle>
                        </dxwgv:GridViewDataButtonEditColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Patente" FieldName="PresupuestoPatente" 
                            VisibleIndex="1">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Tarea" FieldName="Nombre" 
                            VisibleIndex="2">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Entrega" 
                            FieldName="PresupuestoFechaDeEntregaEstimada" VisibleIndex="3">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn Caption="Sector" FieldName="SectorNombre" 
                            ReadOnly="True" VisibleIndex="4">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="Estado" VisibleIndex="5">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataDateColumn Caption="Inicio" 
                            FieldName="FechaInicioRealString" VisibleIndex="6">
                        </dxwgv:GridViewDataDateColumn>
                    </Columns>
                    <StylesEditors>
                        <ProgressBar Height="25px">
                        </ProgressBar>
                    </StylesEditors>
                    <ImagesEditors>
                        <CalendarFastNavPrevYear Height="19px" 
                            Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                        <CalendarFastNavNextYear Height="19px" 
                            Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                        <DropDownEditDropDown Height="7px" 
                            Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                            UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                            UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                            Width="9px" />
                        <SpinEditIncrement Height="7px" 
                            Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                            Width="7px" />
                        <SpinEditDecrement Height="7px" 
                            Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                            Width="7px" />
                        <SpinEditLargeIncrement Height="9px" 
                            Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                            Width="7px" />
                        <SpinEditLargeDecrement Height="9px" 
                            Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                            UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                            Width="7px" />
                    </ImagesEditors>
                </dxwgv:ASPxGridView>
                <asp:ObjectDataSource ID="dsTareasLineaDeTiempo" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    onselecting="dsTareasLineaDeTiempo_Selecting" 
                    SelectMethod="ObtenerTareasActivasDeEmpleado" 
                    TypeName="SGT_ON.ONTareaLineaDeTiempo">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="pEmpleadoId" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="dsMotivos" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="ObtenerTodosLosMotivosDAL" TypeName="SGT_ON.ONMotivo">
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>

